package com.allo2o.common.domain;

import java.util.Date;

public class Token {
    private Integer id;

    private String token;

    private String staticToken;

    private String account;

    private Date gmtCreate;

    private Date gmtModify;

    private int count;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token == null ? null : token.trim();
    }

    public String getStaticToken() {
        return staticToken;
    }

    public void setStaticToken(String staticToken) {
        this.staticToken = staticToken == null ? null : staticToken.trim();
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account == null ? null : account.trim();
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public Date getGmtModify() {
        return gmtModify;
    }

    public void setGmtModify(Date gmtModify) {
        this.gmtModify = gmtModify;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Token)) return false;

        Token token1 = (Token) o;

        if (getCount() != token1.getCount()) return false;
        if (getId() != null ? !getId().equals(token1.getId()) : token1.getId() != null) return false;
        if (getToken() != null ? !getToken().equals(token1.getToken()) : token1.getToken() != null) return false;
        if (getStaticToken() != null ? !getStaticToken().equals(token1.getStaticToken()) : token1.getStaticToken() != null)
            return false;
        if (getAccount() != null ? !getAccount().equals(token1.getAccount()) : token1.getAccount() != null)
            return false;
        if (getGmtCreate() != null ? !getGmtCreate().equals(token1.getGmtCreate()) : token1.getGmtCreate() != null)
            return false;
        return getGmtModify() != null ? getGmtModify().equals(token1.getGmtModify()) : token1.getGmtModify() == null;

    }

    @Override
    public int hashCode() {
        int result = getId() != null ? getId().hashCode() : 0;
        result = 31 * result + (getToken() != null ? getToken().hashCode() : 0);
        result = 31 * result + (getStaticToken() != null ? getStaticToken().hashCode() : 0);
        result = 31 * result + (getAccount() != null ? getAccount().hashCode() : 0);
        result = 31 * result + (getGmtCreate() != null ? getGmtCreate().hashCode() : 0);
        result = 31 * result + (getGmtModify() != null ? getGmtModify().hashCode() : 0);
        result = 31 * result + getCount();
        return result;
    }

    @Override
    public String toString() {
        return "Token{" +
                "id=" + id +
                ", token='" + token + '\'' +
                ", staticToken='" + staticToken + '\'' +
                ", account='" + account + '\'' +
                ", gmtCreate=" + gmtCreate +
                ", gmtModify=" + gmtModify +
                ", count=" + count +
                '}';
    }
}